<?php

namespace app\admin\controller;

class Admin extends Base{

    public function __construct(){
        parent::__construct();
        $this->isLogin();
    }

    private function isLogin(){
        if(session('user.id') <= 0){
            $this->redirect('index/index');
        }
    }

    //定制错误页面
    public function myError($err=''){
        if(!$err){
            $err = '未知错误';
        }
        return $this->fetch('public/error',['err'=>$err]);
    }
}
